% This file creates and saves Figure 3b in 
% Replication_files\Figures\Figure4.eps
clear

cd ../mat_files

load irfs_w_inertia_gov.mat

y_u_i=y_u;
c_u_i=c_u;
dy_u_i=dy_u;
q_u_i=q_u;
mu_u_i=mu_u;
g_u_i=g_u;
pi_u_i=pi_u;
i_u_i=i_u;

load irfs_wo_inertia_gov.mat

fig1b=figure;

%output response

irf_y=subplot(2,4,1);
hold on
plot(1:20,y_u_i,'k','LineWidth',1);
plot(1:20,y_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_y,'\fontsize{10}Output (Y)','fontweight','normal');
box(irf_y,'on');

%consumption response

irf_c=subplot(2,4,2);
hold on
plot(1:20,c_u_i,'k','LineWidth',1);
plot(1:20,c_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_c,'\fontsize{10}Consumption (C)','fontweight','normal')
box(irf_c,'on');

%government spending response

irf_g=subplot(2,4,3);
hold on
plot(1:20,g_u_i,'k','LineWidth',1);
plot(1:20,g_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([0 1.2]);
title(irf_g,'\fontsize{10}Government Spending (g)','fontweight','normal')
box(irf_g,'on');

%output growth response

irf_dy=subplot(2,4,4);
hold on
plot(1:20,dy_u_i,'k','LineWidth',1);
plot(1:20,dy_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([-0.01 0.05]);
title(irf_dy,'\fontsize{10}Output Growth (\DeltaY)','fontweight','normal')
box(irf_dy,'on');

%discount rate response

irf_q=subplot(2,4,5);
hold on
plot(1:20,q_u_i,'k','LineWidth',1);
plot(1:20,q_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([-0.01 0.05]);
title(irf_q,'\fontsize{10}Discount Rate (q)','fontweight','normal')
box(irf_q,'on');

%markup response

irf_mu=subplot(2,4,6);
hold on
plot(1:20,mu_u_i,'k','LineWidth',1);
plot(1:20,mu_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
ylim([-0.01 0.015]);
title(irf_mu,'\fontsize{10}Markup (\mu)','fontweight','normal')
box(irf_mu,'on');

%inflation
irf_pi=subplot(2,4,7);
hold on
plot(1:20,mu_u_i,'k','LineWidth',1);
plot(1:20,mu_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_pi,'\fontsize{10}Inflation (\pi)','fontweight','normal')
box(irf_pi,'on');

%interest rate
irf_i=subplot(2,4,8);
hold on
plot(1:20,mu_u_i,'k','LineWidth',1);
plot(1:20,mu_u,'-.k','LineWidth',1);
plot(1:20,zeros(1,20),'r','LineWidth',0.5);
xlim([1 20]);
title(irf_i,'\fontsize{10}Nominal Rate (i)','fontweight','normal')
box(irf_i,'on');

fig1b.PaperUnits='inches';
fig1b.PaperPosition=[0 0 7.5 3];

cd ../Figures
print('Figure_1b','-depsc','-tiff')
cd ../m_files

clear
